package com.lxj.passkeep.controller.user;


import com.lxj.passkeep.common.result.ResponseResult;
import com.lxj.passkeep.dto.UserDto;

import com.lxj.passkeep.service.LoginService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class LoginController {
    @Resource
    private LoginService loginService;
    // TODO 修改登录 密码加密 封装JWT返回
    @PostMapping("/login")
    public ResponseResult login(@RequestBody UserDto userDto) {
        loginService.login(userDto);
        return ResponseResult.success();
    }
    // TODO 注册 根据用户名创建数据库
}
